
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Tathata.Common.BLL.Entities;
using Tathata.Common.BLL.Managers;
using Tathata.Common.BLL.EntityCollections;
using System.IO;
using Tathata.Common.Utils;

namespace Tathata.Web.Administration
{
    public partial class Administration_Froogle : BaseNopAdministrationPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void btnGenerate_Click(object sender, EventArgs e)
        {
            //if (Page.IsValid)
            //{
            //    try
            //    {
            //        string generatedFeed = FroogleService.GenerateFeed();
            //        string fileName = string.Format("froogle_{0}.xml", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"));
            //        string filePath = string.Format("{0}files\\froogle\\{1}", HttpContext.Current.Request.PhysicalApplicationPath, fileName);
            //        using (FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite))
            //        using (StreamWriter sw = new StreamWriter(fs))
            //        {
            //            sw.Write(generatedFeed);
            //        }
            //        lblResult.Text = string.Format("Froogle feed has been successfully generated. <a href=\"{0}files/froogle/{1}\" target=\"_blank\" \">Click here</a> to see generated feed", CommonHelper.GetStoreHTTPLocation(false), fileName);
            //    }
            //    catch (Exception exc)
            //    {
            //        ProcessException(exc);
            //    }
            //}
        }
    }
}
